package com.educatioin.manage.web.system.repository;

import com.educatioin.manage.web.system.po.CustomerProductShoppingCartPo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

/**
 * Created by BensonZc on 2018/5/4.
 */
@RepositoryRestResource(collectionResourceRel = "customerProductShoppingCartRespository", path = "customerProductShoppingCartRespository")
public interface CustomerProductShoppingCartRespository extends JpaSpecificationExecutor<CustomerProductShoppingCartPo>, PagingAndSortingRepository<CustomerProductShoppingCartPo, Long> {

    CustomerProductShoppingCartPo findByCustomerIdAndProductId(Long customerId, Long productId);

    List<CustomerProductShoppingCartPo> findByCustomerId(Long customerId);
}
